package com.twu.biblioteca;

import java.io.*;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Properties;


public class StringFormatter {

    private final String[] validOptions = {"1", "2", "3", "4", "5", "6"};

    public String getUserInput(String prompt) {
        String option = null;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            printString(prompt);
            option = br.readLine();

        } catch (IOException e) {

        }
        return option;
    }

    public int verifySelectedOption(String option) {

        try {
            return (Arrays.asList(validOptions).contains(option)) ? Integer.parseInt(option) : 7;
        } catch (Exception ex) {
            return 7;
        }
    }

    public void printString(String inputString) {
        System.out.println(inputString);
    }

}
